/**
 * 
 */
package org.vsg.security.policy;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import org.vsg.security.model.domain.SysRole;
import org.vsg.security.vo.SecRole;

/**
 * @author Bill Vison
 *
 */
public class SimpleRolesHandlerPolicy implements RolesHandlerPolicy {

	/* (non-Javadoc)
	 * @see org.vsg.security.policy.RolesHandlerPolicy#handlePolicy(java.util.Set)
	 */
	@Override
	public Set<SecRole> handlePolicy(Set<SysRole> inputRoles)
			throws HandlerPolicyException {
		// TODO Auto-generated method stub
		Set<SecRole> roles = new HashSet<SecRole>();
		for (Iterator<SysRole> iRolesIter = inputRoles.iterator() ; iRolesIter.hasNext();) {
			roles.add( new SecRole(iRolesIter.next()) );
		}
		
		return roles;
	}

}
